<template>
    <div class="account-container">
        <div class="account">
            <input placeholder="账户名/手机号/Email" v-model="val1">
            <input placeholder="请输入您的密码" v-model="val2">
        </div>
        <mt-button type="danger" size="large" @click="getAccount">登录</mt-button>
    </div>
</template>
<script>
export default {
    data(){
        return{
            val1:"",
            val2:"",
            id:''
        }
    },
    created(){

    },
    methods:{
        getAccount(){
            this.$http.post('http://localhost:8888/maoyan/m.php',{
                account:this.val1,
                password:this.val2
            }).then(result=>{
                if(result.body=="success"){
                    this.$cookies.set('accoutCookie', this.val1, 1800);
                    this.$router.push({name:'order', params:{id:this.val1}})
                }
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.account-container{
    .account{
        input:nth-child(1){
            width: 100%;
            height: 40px;
            font-size: 14px;
            border: none;
            border-bottom: 1px solid lightgray;
        }
        input:nth-child(2){
            margin-top: 10px;
            width: 100%;
            height: 40px;
            font-size: 14px;
            border: none;
            border-bottom: 1px solid lightgray;
        }
    }
    .mint-button{
        margin-top: 30px;
    }
}
</style>
